package es.us.lsi.daw.soportePropiedades;

import java.beans.PropertyEditorSupport;

import es.us.lsi.daw.model.util.BaseEntity;



public class BaseEntityEditor extends PropertyEditorSupport{

	
	public BaseEntityEditor(){
	}
	
	@Override
	public String getAsText() {
		if(this.getValue() != null && this.getValue().getClass().getSuperclass().equals(BaseEntity.class) && ((BaseEntity)this.getValue()).getId() !=  null)
			return ((BaseEntity)this.getValue()).getId().toString();
		return super.getAsText();
	}

}
